import {createSlice} from '@reduxjs/toolkit'
import store2 from 'store2'

const appSlice = createSlice({
    name:'app',
    initialState:{
        collapsed:store2.get('collapsed')
    },
    reducers:{
        changeCollapsed(state,action) {
            state.collapsed =action.payload
            console.log(state.collapsed);
            store2.set('collapsed',state.collapsed)
        }
    }
})

export const {changeCollapsed} = appSlice.actions
export default appSlice.reducer